home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / ODF / OS / FWGraphx / FWGXUtil.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  2.5 KB  |  123 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWGXUtil.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWGXUTIL_H
  11. #define FWGXUTIL_H
  12.  
  13. #ifndef FWGXCFG_H
  14. #include "FWGXCfg.h"
  15. #endif
  16.  
  17. #ifdef FW_SUPPORT_GX        // This file is only for QuickDraw GX
  18.  
  19. #ifndef FWSTDDEF_H
  20. #include "FWStdDef.h"
  21. #endif
  22.  
  23. #ifndef FWEXCDEF_H
  24. #include "FWExcDef.h"
  25. #endif
  26.  
  27. #ifdef FWODEXCE_H
  28. #include "FWODExce.h"
  29. #endif
  30.  
  31. #ifndef __GXTYPES__
  32. #include <GXTypes.h>
  33. #endif
  34.  
  35. //========================================================================================
  36. // Forward declarations
  37. //========================================================================================
  38.  
  39. struct Environment;
  40.  
  41. class ODFrame;
  42. class ODShape;
  43. class ODFacet;
  44.  
  45. //========================================================================================
  46. // Global functions
  47. //========================================================================================
  48.  
  49. // General utils
  50.  
  51. FW_Boolean        FW_IsGXInstalled();
  52. FW_Boolean        FW_IsGXPrintingInstalled();
  53.  
  54. void            FW_Priv_GX_Initialize();
  55. void            FW_Priv_GX_Terminate();
  56.  
  57. //========================================================================================
  58. // class FW_CGraphicContextGX
  59. //========================================================================================
  60.  
  61. class FW_CGraphicContextGX
  62. {
  63. // ----- Construction/destruction
  64.  
  65. public:
  66.     FW_DECLARE_AUTO(FW_CGraphicContextGX)
  67.  
  68.                     FW_CGraphicContextGX(
  69.                         Environment* ev,
  70.                         ODFacet* facet,
  71.                         ODShape* invalidShape = NULL);
  72.     virtual            ~FW_CGraphicContextGX();
  73.  
  74. // ----- Drawing
  75.  
  76. public:
  77.  
  78.     void            DrawShape(gxShape shape);
  79.     gxTransform        GetGXTransform() const;
  80.  
  81. // ----- Implementation
  82.  
  83. private:
  84.     gxTransform        fGXTransform;
  85.     gxViewPort        fGXViewPort;
  86.  
  87.     // -----
  88.  
  89.     gxMapping        fMapping;
  90.     gxMapping        fOldMapping;
  91.  
  92.     void            SetupTransformMapping(
  93.                         Environment* ev,
  94.                         ODFacet* facet);
  95.                         
  96.     void            RestoreTransformMapping();
  97.  
  98.     // -----
  99.  
  100.     gxShape            fTransformClipOld;
  101.  
  102.     void            SetupTransformClipping(
  103.                         Environment* ev,
  104.                         ODFacet* facet);
  105.  
  106.     void            RestoreTransformClipping();
  107.  
  108.     // -----
  109.  
  110.     gxShape            fViewPortClipOld;
  111.  
  112.     void            SetupViewPortClipping(
  113.                         Environment* ev,
  114.                         ODFacet* facet,
  115.                         ODShape* invalidShape);
  116.  
  117.     void            RestoreViewPortClipping();
  118. };
  119.  
  120. #endif    // FW_SUPPORT_GX
  121.  
  122. #endif    // FWGXUTIL_H
  123.